<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_id" data-rule="required" data-source="category/selectpage"
                data-params='{"custom[type]":"goods"}' class="form-control selectpage" name="row[category_id]"
                type="text" value="{$row.category_id|htmlentities}">
        </div>
    </div> -->
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('授权平台')}:</label>
        <div class="col-xs-12 col-sm-8">

            <table class="table fieldlist" data-name="row[acct_json]" data-template="row[acct_json]tpl">
                <tr>
                    <td>{:__('平台')}</td>
                    <td>{:__('售价')}</td>
                    <td>{:__('进货价')}</td>
                    <td width="90">{:__('Operate')}</td>
                </tr>
                <tr>
                    <td colspan="3">
                        <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>
                            {:__('Append')}</a>
                        <textarea name="row[acct_json]" class="form-control hide" cols="30"
                            rows="5">{$row['acct_json']}</textarea>
                    </td>
                </tr>
            </table>
            <script type="text/html" id="row[acct_json]tpl">
                <tr>
                    <td><input type="text" name="<%=name%>[<%=index%>][acct_id]" class="form-control selectpage" data-source="auth/admin/selectgroup" data-field="nickname" data-primary-key="acct_id" value="<%=row.acct_id%>" placeholder="平台"/></td>
                    <td>
                        <input type="text" name="<%=name%>[<%=index%>][price]" class="form-control " value="<%=row.price%>" placeholder="售价"/>
                        <input type="hidden" name="<%=name%>[<%=index%>][id]" class="form-control " value="<%=row.id%>"/>
                    </td>
                    <td><input type="text" name="<%=name%>[<%=index%>][purchase_price]" class="form-control " value="<%=row.purchase_price%>" placeholder="进货价"/></td>
                    <td width="90">
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text"
                value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Thumb_image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-thumb_image" class="form-control" size="50" name="row[thumb_image]" type="text"
                    value="{$row.thumb_image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-thumb_image" class="btn btn-danger faupload"
                            data-input-id="c-thumb_image"
                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                            data-multiple="false" data-preview-id="p-thumb_image"><i class="fa fa-upload"></i>
                            {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-thumb_image" class="btn btn-primary fachoose"
                            data-input-id="c-thumb_image" data-mimetype="image/*" data-multiple="false"><i
                                class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-thumb_image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-thumb_image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('检验报告')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-check_image" class="form-control" size="50" name="row[check_image]" type="text"
                    value="{$row.check_image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-check_image" class="btn btn-danger faupload"
                            data-input-id="c-check_image"
                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                            data-multiple="false" data-preview-id="p-check_image"><i class="fa fa-upload"></i>
                            {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-check_image" class="btn btn-primary fachoose"
                            data-input-id="c-check_image" data-mimetype="image/*" data-multiple="false"><i
                                class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-check_image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-check_image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" class="form-control" size="50" name="row[images]" type="text"
                    value="{$row.images|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-images" class="btn btn-danger faupload"
                            data-input-id="c-images"
                            data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp"
                            data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i>
                            {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose"
                            data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i
                                class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-images"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('标签')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-tags" class="form-control" data-role="tagsinput" name="row[tags]" type="text"
                value="{$row.tags|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number"
                value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('邀请有礼')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select id="c-only_fx" data-rule="required" class="form-control selectpicker" name="row[only_fx]">

                <option value="0" {if $row.only_fx==0 }selected{/if}>否</option>
                <option value="1" {if $row.only_fx==1 }selected{/if}>是</option>


            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sale_switch')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select id="c-sale_switch" data-rule="required" min="0" class="form-control selectpicker"
                name="row[sale_switch]">
                {foreach name="saleSwitchList" item="vo"}
                <option value="{$key}" {in name="key" value="$row.sale_switch" }selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('进货价')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-purchase_price" min="0" class="form-control" step="0.01" name="row[purchase_price]"
                type="number" value="{$row.purchase_price|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price" min="0" class="form-control" step="0.01" name="row[price]" type="number"
                value="{$row.price|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('起购')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-limited" min="0" class="form-control" data-rule="required;range(1~)" step="0.01"
                name="row[limited]" type="number" value="{$row.limited|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Stock')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-stock" min="0" class="form-control" step="0.01" name="row[stock]" type="number"
                value="{$row.stock|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Sale_num')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-sale_num" min="0" class="form-control" step="0.01" name="row[sale_num]" type="number"
                value="{$row.sale_num|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('重量（斤）')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weight" min="0" step="0.01" class="form-control" name="row[weight]" type="number"
                value="{$row.weight|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Unit')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-unit" class="form-control" name="row[unit]" type="text" value="{$row.unit|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Intro')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-intro" class="form-control" name="row[intro]" type="text" value="{$row.intro|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('产品味型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-taste_pattern" class="form-control" name="row[taste_pattern]" type="text"
                value="{$row.taste_pattern|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('麻辣指数')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-spicy_index" class="form-control" name="row[spicy_index]" type="text"
                value="{$row.spicy_index|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('对标品牌')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-brand" class="form-control" name="row[brand]" type="text" value="{$row.brand|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('适用区域')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-area" class="form-control" name="row[area]" type="text" value="{$row.area|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('关联用户')}:</label>
        <div class="col-xs-12 col-sm-8">

            <table class="table fieldlist" data-name="row[user_json]" data-template="row[user_json]tpl">
                <tr>
                    <td>{:__('用户')}</td>
                    <td width="90">{:__('Operate')}</td>
                </tr>
                <tr>
                    <td colspan="3">
                        <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>
                            {:__('Append')}</a>
                        <textarea name="row[user_json]" class="form-control hide" cols="30"
                            rows="5">{$row.user_json|htmlentities}</textarea>
                    </td>
                </tr>
            </table>
            <script type="text/html" id="row[user_json]tpl">
                <tr>
                    <td>
                        <input type="hidden" name="<%=name%>[<%=index%>][id]" class="form-control" value="<%=row.id%>"/>
                        <input type="text" name="<%=name%>[<%=index%>][user_id]" class="form-control selectpage" data-source="user/user/index" data-field="mobile" value="<%=row.user_id%>" placeholder="用户"/>
                    </td>
                    <td width="90">
                        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                    </td>
                </tr>
            </script>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-custom" class="form-control" name="row[custom]" type="hidden"
                value="{$row.custom|htmlentities}">
            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]"
                cols="50">{$row.content|htmlentities}</textarea>
        </div>
    </div>
    {if $acct_id==0}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
    {/if}
</form>